﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true"
    CodeFile="ThongKeTonKho.aspx.cs" Inherits="WebTeamplate.Admin_ThongKeTonKho" %>

<%@ Register Assembly="Control" Namespace="PagerControl" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <script src="../Js/BasicFunction.js"></script>

    <script src="../Js/ListView.js"></script>

    <script src="../Js/Popup.js"></script>

    <table class="lvtBg" border="0" cellpadding="0" cellspacing="1" width="100%">
        <tbody>
            <tr>
                <td align="center">
                    <table class="small" border="0" cellpadding="2" cellspacing="5" width="100%">
                        <tr>
                            <td align="right" style="width: 150px;">
                                Chọn Kho:
                            </td>
                            <td align="left" style="width: 150px;">
                                <asp:DropDownList ID="drlKho" Width="120px" runat="server">
                                </asp:DropDownList>
                            </td>
                            <td align="right" style="width: 100px;">
                                Loại mặt hàng:
                            </td>
                            <td align="left">
                                <asp:DropDownList ID="drlLoaiMH" runat="server" Width="120px" AutoPostBack="true"
                                    OnSelectedIndexChanged="drlLoaiMH_SelectedIndexChanged">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" style="width: 150px;">
                                Chủng xe
                            </td>
                            <td align="left">
                                <asp:DropDownList ID="drlChungXe" Width="120px" AutoPostBack="true" runat="server"
                                    OnSelectedIndexChanged="drlChungXe_SelectedIndexChanged">
                                </asp:DropDownList>
                            </td>
                            <td align="right">
                                Xe
                            </td>
                            <td align="left">
                                <asp:DropDownList ID="drlXe" Width="120px" runat="server" AutoPostBack="True" OnSelectedIndexChanged="drlXe_SelectedIndexChanged">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                Mã mặt hàng:
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtMaMatHang" runat="server" Width="120px"></asp:TextBox>
                            </td>
                            <td align="right">
                                Mã phụ tùng:
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtMaPhuTung" runat="server" Width="120px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td align="left" colspan="3">
                                <asp:Button ID="btnThongKe" runat="server" Text="Thống kê" OnClick="btnThongKe_Click"
                                    meta:resourcekey="btnSearchResource1" CssClass="crmbutton small edit" />
                                <asp:Button ID="btnReset" runat="server" Text="Reset" meta:resourcekey="btnResetResource1"
                                    CssClass="crmbutton small edit" OnClick="btnReset_Click" />
                                <asp:Button ID="btnSortOrder" runat="server" Text="Sort" OnClick="btnSortOrder_Click"
                                    meta:resourcekey="btnSearchResource1" CssClass="hidButton" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    <hr noshade="noshade" size="1">
                </td>
            </tr>
            <tr>
                <td align="right">
                    <cc1:Pager ID="Pager1" runat="server" OnPageIndexChanging="Pager1_PageIndexChanging"
                        OnPageSizeChanging="Pager1_PageSizeChanging" meta:resourcekey="Pager1Resource1"
                        PageIndex="1" PageSize="2" SelectRecord="0" TotalPage="1" TotalRecord="0" />
                </td>
            </tr>
            <tr>
                <td>
                    <%=data %>
                </td>
            </tr>
            <%--   <tr>
                <td align="center">
                    <br />
                    <input type="button" style="display:ni" value="In" class="crmbutton small edit" onclick="popImg();" />
                </td>
            </tr>--%>
        </tbody>
    </table>
    <input type="hidden" runat="server" value="" id="hidSortField" />
    <input id="hidSortExpression" type="hidden" runat="server" value="" />

    <script type="text/javascript">
        function SortOrder(field, exp) {
            document.getElementById('<%=hidSortField.ClientID %>').value = field;
            document.getElementById('<%=hidSortExpression.ClientID %>').value = exp;
            var btn = document.getElementById('<%=btnSortOrder.ClientID %>');
            if (btn)
                btn.click();
        }
        function ClearFrom() {

            document.getElementById('<%=drlKho.ClientID %>').value = '';
            document.getElementById('<%=drlChungXe.ClientID %>').value = '';
            document.getElementById('<%=drlXe.ClientID %>').value = '';
            document.getElementById('<%=txtMaMatHang.ClientID %>').value = '';
            document.getElementById('<%=txtMaPhuTung.ClientID %>').value = '';
            return false;
        }
        function popImg(id) {
            var kho = document.getElementById('<%=drlKho.ClientID %>').value;
            var loaihh = document.getElementById('<%=drlLoaiMH.ClientID %>').value;
            var mh = document.getElementById('<%=txtMaMatHang.ClientID %>').value;
            var pt = document.getElementById('<%=txtMaPhuTung.ClientID %>').value;
            var pURL = "PopupThongKeTonKho.aspx?kho=" + kho + "&mh=" + mh & "&mapt=" + pt;
            var w = 930;
            var h = 680;
            var wleft = (screen.width - w) / 2;
            var wtop = (screen.height - h) / 2;
            // IE5 and other old browsers might allow a window that is
            // partially offscreen or wider than the screen. Fix that.
            // (Newer browsers fix this for us, but let's be thorough.)
            if (wleft < 0) {
                w = screen.width;
                wleft = 0;
            }
            if (wtop < 0) {
                h = screen.height;
                wtop = 0;
            }

            //var pURL='map.html';
            pInfo = 'toolbar=1,';
            pInfo += 'location=0,';
            pInfo += 'directories=0,';
            pInfo += 'status=0,';
            pInfo += 'menubar=1,';
            pInfo += 'scrollbars=1,';
            pInfo += 'resizable=1,';
            pInfo += 'width=' + w + 'px,';
            pInfo += 'height=' + h + 'px,';
            pInfo += 'left=' + wleft + ',';
            pInfo += 'top=' + wtop + ',';
            pInfo += 'text-align:center';
            //alert(pInfo);
            window.open(pURL, 'TonKho', pInfo, true);

        }
    
    </script>

</asp:Content>
